package cn.org.timespace.easyframe.demo;

/**
 * 报表Action
 * @author <a href="mailto:jeremyfan@sohu.com">Jeremy</a> 2010-9-25 
 * @version 1.0      
 */

import javax.servlet.http.HttpServletResponse;

import cn.org.timespace.easyframe.action.EFBaseAction;
import cn.org.timespace.easyframe.util.report.model.Report;

public class DemoReportAction extends EFBaseAction {

	private static final long serialVersionUID = 6248498076323921169L;

	private DemoReportService mmsMemberDevReportService = MmsMemberDevReportServiceImpl
			.getInstance();

	public String showDemo() throws Exception {

		Report report = null;
		report = mmsMemberDevReportService.getReport();
		getRequest().setAttribute(REPORT, report);

		return SUCCESS;
	}

	public String exportDemo() throws Exception {
		HttpServletResponse response = getResponse();
		response.setContentType("application/vnd.ms-excel; charset=utf-8");
		response.setHeader("Content-disposition",
				"attachment; filename=MemberDevReport.xls");

		return showDemo();
	}

}
